import request from '@/utils/request'

// 查询课程列表
export function listVideo (query) {
  return request({
    url: '/system/video/list',
    method: 'get',
    params: query
  })
}
export function listDeptVideo (query) {
  return request({
    url: '/biz/video/list',
    method: 'get',
    params: query
  })
}
// 查询课程详细
export function getVideo (rid) {
  return request({
    url: '/system/video/getInfo/' + rid,
    method: 'get'
  })
}

// 新增课程
export function addVideo (data) {
  return request({
    url: '/system/video/addVideo',
    method: 'post',
    data: data
  })
}

// 修改课程
export function updateVideo (data) {
  return request({
    url: '/system/video/editVideo',
    method: 'put',
    data: data
  })
}

// 删除课程
export function delVideo (rid) {
  return request({
    url: '/system/video/delVideo/' + rid,
    method: 'delete'
  })
}
export function delDeptVideo (rid) {
  return request({
    url: '/biz/video/delVideo/' + rid,
    method: 'delete'
  })
}


// 删除章节
export function delZhangJie (rid) {
  return request({
    url: '/system/outline/delOutline/' + rid,
    method: 'delete'
  })
}

// 删除视频
export function delShiPin (rid) {
  return request({
    url: '/system/detail/delDetail/' + rid,
    method: 'delete'
  })
}

// 分配课程
export function fenPei (data) {
  return request({
    url: '/system/video/syncVideoToDept',
    method: 'post',
    data: data
  })
}